﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using WCFServiceWebRole1.DataObjects;

namespace WCFServiceWebRole1.Services
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IChart" in both code and config file together.
    [ServiceContract]
    public interface IChart
    {
        //Get data for range chart
        [OperationContract]
        [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Bare,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "sensordata/paeginfo?userid={userid}&sensorid={sensorid}&start={start}&end={end}&pagesize={pagesize}")]
        [Description("Get the pages for historic data. Time should be UTC")]
        SensorDataGetPageInfoContract getSensorDataPagingInfo(int userid, int sensorid, string start, string end, int pagesize);

        [OperationContract]
        [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Bare,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "sensordata/pagedata?userid={userid}&sensorid={sensorid}&start={start}&end={end}&pagesize={pagesize}")]
        string getSensorDataByPagingUrl(int userid, int sensorid, string start, string end, int pagesize);

        [OperationContract]
        [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Bare,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "testping?sensorid={sensorid}")]
        string testping(int sensorid);
    }
}
